<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <title>Castro de Notas</title>  
        <script type="text/javaScript">
            function setValue(){
                var combo = document.form.bimestre;
                for(var i = 0;i< combo.options.length;i++){
                    if(combo.options[i].selected){
                        alert("oi");
                        document.form.bimestre.value = combo.options[i].value;
                    }
                }
            }
        </script>
    </head>
    <body>
        <c:set var="idCurso" value="${param.idCurso}"/>
        <c:set var="idDisciplina" value="${param.idDisciplina}"/>
        <sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver" 
                   url="jdbc:mysql://localhost:3306/avaliacao1" user="root" password="root" scope="session"/>
    <sql:query var="alunos" dataSource="${dataSource}">
        select p.nome, a.idAluno from aluno a, pessoa p where a.idCurso = ${idCurso} and p.idPessoa = a.idPessoa
    </sql:query>
        <form name="form" method="post">
        
        <input type="hidden" name="bimestre" value=""/>
        <table border=1>            
            <c:forEach  items="${alunos.rows}" var="aluno">
                <tr>
                    <c:url value="mostrarAlunosDisciplina.jsp" var="urlCad">
                        <c:param name="idDisciplina" value="${idDisciplina}"/>
                        <c:param name="idCurso" value="${idCurso}"/>
                        <c:param name="idAluno" value="${aluno.idAluno}"/>
                        
                    </c:url>                    
                <a href=""/>
                <td><c:out value="${aluno.nome}"/></td>
            </tr>
            <td><a  href="${urlCad}">Cadastrar</a></td>
        </c:forEach>
        </table>
     </form>
    </body>
</html>